package com.fourhats.services;

import java.util.List;

import org.springframework.stereotype.Service;

import com.fourhats.exception.NotAllowedAnonymousException;
import com.fourhats.exception.UserNotOwerOfProductException;
import com.fourhats.services.dto.AnswerDto;
import com.fourhats.services.dto.QuestionDto;
import com.fourhats.services.util.Page;

@Service
public interface QuestionService {

	List<QuestionDto> getQuestions(long entityId, int entityType);
	
	List<QuestionDto> getQuestionsWithAnswers(long entityId, int entityType, int quantityAnswers);
	
	Page<AnswerDto> getAnswer(long questionId, int pageNumber, int pageSize);
	
	QuestionDto createQuestion(String description, long userId, long entityId, int entityType) throws NotAllowedAnonymousException;
	
	AnswerDto answerQuestion(String description, long userId, long questionId) throws NotAllowedAnonymousException, UserNotOwerOfProductException;

	boolean hasUnvisitedQuestions(long userId);
	
	Page<QuestionDto> getQuestionsToUser(long userId, int pageNumber, int pageSize);
	
	Page<QuestionDto> getQuestionsMadeByUser(long userId, int pageNumber, int pageSize);

	QuestionDto getQuestionById(long questionId);
}
